package com.hejia.bulbul.entity;

import java.math.BigDecimal;

import com.hejia.alauda.entity.Channel;

/**
 * 渠道统计
 * 
 * @author hyr
 *
 */
public class ChannelStatistic {

	private Channel channel; // 渠道

	private Long registerCount; // 注册数

	private Long realNameCount; // 实名认证数

	private Long orderCount; // 下单数

	private Long paidOrderCount; // 支付订单数

	private Long paidUserCount; // 下单支付用户数

	private BigDecimal paymentAmount; // 下单支付金额数

	public Long getPopularizeId() {
		if (this.channel.getNumber().startsWith("P:")) {
			return Long.parseLong(this.channel.getNumber().replace("P:", "").split("-")[2]);
		}
		return null;
	}
	
	public Channel getChannel() {
		return channel;
	}

	public void setChannel(Channel channel) {
		this.channel = channel;
	}
	
	public Long getRegisterCount() {
		if (registerCount == null) {
			return 0L;
		}
		return registerCount;
	}

	public void setRegisterCount(Long registerCount) {
		this.registerCount = registerCount;
	}

	public Long getRealNameCount() {
		if (realNameCount == null) {
			return 0L;
		}
		return realNameCount;
	}

	public void setRealNameCount(Long realNameCount) {
		this.realNameCount = realNameCount;
	}

	public Long getOrderCount() {
		if (orderCount == null) {
			return 0L;
		}
		return orderCount;
	}

	public void setOrderCount(Long orderCount) {
		this.orderCount = orderCount;
	}

	public Long getPaidOrderCount() {
		if (paidOrderCount == null) {
			return 0L;
		}
		return paidOrderCount;
	}

	public void setPaidOrderCount(Long paidOrderCount) {
		this.paidOrderCount = paidOrderCount;
	}

	public BigDecimal getPaymentAmount() {
		if (paymentAmount == null) {
			return BigDecimal.ZERO;
		}
		return paymentAmount;
	}

	public void setPaymentAmount(BigDecimal paymentAmount) {
		this.paymentAmount = paymentAmount;
	}

	public Long getPaidUserCount() {
		if (paidUserCount == null) {
			paidUserCount = 0L;
		}
		return paidUserCount;
	}

	public void setPaidUserCount(Long paidUserCount) {
		this.paidUserCount = paidUserCount;
	}
}
